package com.xunshibao.util;

import java.util.Calendar;
import java.util.Date;

public class DateUtil {
	public static int getNow() {
		return Long.valueOf(System.currentTimeMillis() / 1000).intValue();
	}
	
	public static int date2Int(Date date) {
		return Long.valueOf(date.getTime() / 1000).intValue();
	}
	public static Date int2Date(int date) {
		System.out.println(date*1000l);
		return new Date(date*1000l);
	}
	
	public static int addDate(Date now, int style, int amount) {
		Calendar c = Calendar.getInstance();
		c.setTime(now);
		c.add(Calendar.DAY_OF_MONTH, 1);
		
		return date2Int(c.getTime());
	}
}
